//
//  UIStory_Main.m
//  CourseDemo
//
//  Created by yanyan on 2017/8/5.
//  Copyright © 2017年 yanyan. All rights reserved.
//

#import "UIStory_Main.h"
#import "CYConfig_Image.h"
#import "UIStory_CHome.h"
#import "UIStory_CUserCenter.h"
#import "UIStory_CSecond.h"

@interface UIStory_Main()
@property(nonatomic,strong) UIStory_CHome *uistory_home;
@property(nonatomic,strong) UIStory_CSecond *uistory_second;
@property(nonatomic,strong) UIStory_CUserCenter *uistory_me;
@end
@implementation UIStory_Main
- (instancetype)init
{
    self = [super init];
    if (self) {
        self.uistory_home = [[UIStory_CHome alloc]init];
        self.uistory_second = [[UIStory_CSecond alloc]init];
        self.uistory_me = [[UIStory_CUserCenter alloc]init];
        NSArray *titles = @[@"课程",@"分类",@"我的"];
        
        NSArray *imagesArr = @[[UIImage imageNamed:@"tabbar_0_normal"],
                               [UIImage imageNamed:@"tabbar_1_normal"],
                               [UIImage imageNamed:@"tabbar_2_normal"],
                               [UIImage imageNamed:@"tabbar_0_selected"],
                               [UIImage imageNamed:@"tabbar_1_selected"],
                               [UIImage imageNamed:@"tabbar_2_selected"]];
        NSArray *vcsArr = @[self.uistory_home.navigationController,self.uistory_second.navigationController,self.uistory_me.navigationController];
        
        for (int i = 0; i<titles.count; i++) {
            NSString* title = titles[i];
            UIViewController *vc = vcsArr[i];
            vc.title = title;
            vc.tabBarItem.image = imagesArr[i];
            vc.tabBarItem.selectedImage = imagesArr[i+3];
        }
        self.vcConfigs = vcsArr;
    }
    return self;
}

@end
